<template>
  <div>
    <div class="head">
      <img :src="'back.png' | imagePath" class="head-back">
      <p>添加电池</p>
      <span></span>
    </div>
    <div class="batteryAdd-content">
      <div class="batteryAdd-item">
        <span>电池标题</span>
        <input type="text" placeholder="输入电池标题">
      </div>
      <div class="batteryAdd-item">
        <span>电瓶类别</span>
        <p
          @click="typeIndex = index"
          :class="typeIndex== index ? 'active' : ''"
          v-for="(item,index) in ['铅酸','锂电']"
          :key="item">
          <em></em>{{item}}
        </p>
      </div>
      <div class="batteryAdd-item">
        <span>订单方式</span>
        <p
          @click="orderIndex = index"
          :class="orderIndex== index ? 'active' : ''"
          v-for="(item,index) in ['购买','租赁']"
          :key="item">
          <em></em>{{item}}
        </p>
      </div>
      <div class="batteryAdd-item">
        <span>电池型号</span>
        <input type="text" placeholder="输入商品型号">
      </div>
      <div class="batteryAdd-item-buy" v-if="orderIndex == 0">
        <div class="batteryAdd-item">
          <span>库存</span>
          <input type="text" placeholder="输入库存">
        </div>
        <div class="batteryAdd-item">
          <span>售价</span>
          <input type="text" placeholder="输入售价">
        </div>
      </div>
      <div class="batteryAdd-item-rent" v-if="orderIndex == 1">
        <div class="batteryAdd-item">
          <span>押金</span>
          <input type="text" placeholder="输入押金">
        </div>
        <div class="batteryAdd-rent-main">
          <div class="batteryAdd-rent-item">
            <h1>时长</h1>
            <p>1天</p>
            <p>1个月</p>
          </div>
          <div class="batteryAdd-rent-item">
            <h1>换电券(张)</h1>
            <p><input type="text" placeholder="输入"></p>
            <p><input type="text" placeholder="输入"></p>
          </div>
          <div class="batteryAdd-rent-item">
            <h1>2元充电券(张)</h1>
            <p><input type="text" placeholder="输入"></p>
            <p><input type="text" placeholder="输入"></p>
          </div>
          <div class="batteryAdd-rent-item">
            <h1 class="textRight">租金</h1>
            <p><input type="text" placeholder="输入"></p>
            <p><input type="text" placeholder="输入"></p>
          </div>
        </div>
      </div>
    </div>
    <div class="batteryAdd-picture">
      <h1>缩略图 <em>建议尺寸: 200*200,限1张</em></h1>
      <img :src="'addImg.png' | imagePath" />
    </div>
    <div class="batteryAdd-picture">
      <h1>滚动图 <em>建议尺寸: 750*750,最多5张</em></h1>
      <div class="batteryAdd-picture-wrap">
        <img :src="'addImg.png' | imagePath" />
      </div>
    </div>
    <div class="batteryAdd-picture">
      <h1>详情图 <em>建议尺寸：宽度750，高度不限，张数不限</em></h1>
      <img :src="'addImg.png' | imagePath" />
    </div>
    <div class="batteryAdd-btn">添加</div>

  </div>
</template>

<script>
  export default{
    data(){
      return{
        typeIndex:0,
        orderIndex:0
      }
    }
  }
</script>
<style>
  .batteryAdd-content{
    background-color: #FFFFFF;
    margin: 0.4rem 0 0.26rem;
  }
.batteryAdd-item{
    border-bottom: 1px solid #EEEEEE;
    height: 1.46rem;
    display: flex;
    align-items: center;
  }
  .batteryAdd-item span{
    font-size: 0.38rem;
    margin-right: 0.6rem;
    margin-left: 0.4rem;
    width: 1.73rem;
  }
  .batteryAdd-item p{
    display: flex;
    align-items: center;
    margin-right: 0.93rem;
  }
  .batteryAdd-item p em{
    width: 0.4rem;
    height: 0.4rem;
    background: url(../../assets/images/check.png) no-repeat;
    background-size: 100% 100%;
    margin-right: 0.17rem;
  }
  .batteryAdd-item p.active em{
    background: url(../../assets/images/checked.png) no-repeat;
    background-size: 100% 100%;
  }
  .batteryAdd-item input{
    flex: 1;
  }
  .batteryAdd-picture{
    background-color: #FFFFFF;
    padding: 0.4rem 0.4rem;
    margin-bottom: 0.26rem;
  }
  .batteryAdd-picture h1{
    font-size: 0.38rem;
    color: #343434;
    margin-bottom: 0.4rem;
  }
  .batteryAdd-picture h1 em{
    color: #9A9A9A;
    font-size: 0.32rem;
  }
  .batteryAdd-picture img{
    width: 2.1rem;
    height: 2.1rem;
  }
  .batteryAdd-picture-wrap{
    display: flex;
    flex-wrap: wrap;
  }
  .batteryAdd-picture-wrap img{
    margin-right: 0.26rem;
    margin-bottom: 0.26rem;
  }
  .batteryAdd-btn{
    width: 9.2rem;
    margin:0.4rem auto;
    border-radius: 0.58rem;
    color: #FFFFFF;
    background-color: #6EC6C6;
    text-align: center;
    font-size: 0.38rem;
    padding: 0.26rem 0;
  }
  .batteryAdd-rent-main{
    display: flex;
    justify-content: space-between;
    padding: 0 0.4rem;
  }
  .batteryAdd-rent-item h1{
    font-size: 0.32rem;
    color: #343434;
    margin: 0.4rem 0;
  }
  .batteryAdd-rent-item p{
    margin-bottom: 0.33rem;
    line-height: 0.69rem;
  }
  .batteryAdd-rent-item p input{
    width: 1.26rem;
    padding: 0 0.26rem;
    line-height: 0.66rem;
    border: 1px solid #EEEEEE;
    border-radius: 0.1rem;
  }
  .batteryAdd-rent-item .textRight{
    text-align: right;
  }

</style>
